import arcade
import math

SCREEN_WIDTH = 600
SCREEN_HEIGHT = 600

arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Bridge")
arcade.set_background_color(arcade.color.PINK)

arcade.start_render()

start_x = 50     # 大桥开始的位置
center_x = 300   # 弧形中心x坐标
center_y = 150   # 弧形中心y坐标
# 绘制大桥底线
arcade.draw_line(0, center_y, SCREEN_WIDTH, center_y, color=arcade.color.BLACK, line_width=4)
# 绘制拱桥外层
arcade.draw_arc_outline(center_x, center_y, 500, 500, arcade.color.BLACK, 0, 180, border_width=16)
# 绘制拱桥内层
arcade.draw_arc_outline(center_x, center_y, 250, 250, arcade.color.BLACK, 0, 180, border_width=3)

i = 1
step = 10  # x方向上每隔10步画一条直线

while i*step < 500:
    # 竖线结束点的y坐标
    end_y = math.sqrt(250*250 - (250-i*step)*(250-i*step)) + center_y
    # 竖线的x坐标
    line_x = start_x + i * step
    arcade.draw_line(line_x, center_y, line_x, end_y, arcade.color.BLACK)
    i += 1

arcade.finish_render()

arcade.run()